library(tidyverse)
library(sjlabelled)
gp_covid <-
read_csv2("./data/ZA5667_v1-1-0.csv") %>%
set_na(na = c(-99, -77, -33, 98))
1
Create a new character string (!) variable based on the age_cat variable that indicates younger people (values 0 to 9) and the elderly (value of 10).
You need the case_when() function for that purpose. Consider using a tidyselect helper such as between()
2
Repeat the previous task with the differentation between married and unmarried people using the marstat variable.
Your variable should have 4 distinct values. You can concatenate logical operations using the & operator.